package com.kaishengit.pojo;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.Cache;
import org.hibernate.annotations.CacheConcurrencyStrategy;
import org.hibernate.annotations.GenericGenerator;

@Entity
@Table(name="t_email")
//@Cache(usage=CacheConcurrencyStrategy.READ_WRITE)
public class Email {
	private String emialid;
	private String emial;
	private Contact contact;
	private Type type;
	
	@Id
	@GenericGenerator(name="pk",strategy="uuid")
	@GeneratedValue(generator="pk")
	public String getEmialid() {
		return emialid;
	}
	public void setEmialid(String emialid) {
		this.emialid = emialid;
	}
	public String getEmial() {
		return emial;
	}
	public void setEmial(String emial) {
		this.emial = emial;
	}
	@ManyToOne(fetch=FetchType.EAGER,cascade={CascadeType.REMOVE})
	@JoinColumn(name="contactid")
	public Contact getContact() {
		return contact;
	}
	public void setContact(Contact contact) {
		this.contact = contact;
	}
	@ManyToOne(fetch=FetchType.EAGER,cascade={CascadeType.REMOVE})
	@JoinColumn(name="typeid")
	public Type getType() {
		return type;
	}
	public void setType(Type type) {
		this.type = type;
	}

}
